package com.apobates.jforum2.troll.regular.event;

import com.apobates.jforum2.troll.regular.ActionOperatorLog;
import com.apobates.jforum2.troll.regular.ForumActionEnum;
import com.google.gson.Gson;

import java.time.LocalDateTime;

/**
 * 回复操作日志
 * @author xiaofanku
 * @since 20210925
 */
public class PostsActionLog implements ActionOperatorLog {
    private long memberId;
    private String memberNickname;
    private ForumActionEnum action;
    private long topicId;
    //private String topicTitle;
    private long postsId;
    private long rodeMember;
    private String ipAddr;
    private String token;
    //访问地址
    private String link;
    //操作的日期
    private LocalDateTime dateTime;

    public PostsActionLog() {
    }

    public long getMemberId() {
        return memberId;
    }

    public String getMemberNickname() {
        return memberNickname;
    }

    public ForumActionEnum getAction() {
        return action;
    }

    public long getTopicId() {
        return topicId;
    }

    public long getRodeMember() {
        return rodeMember;
    }

    public String getIpAddr() {
        return ipAddr;
    }

    public String getToken() {
        return token;
    }

    public long getPostsId() {
        return postsId;
    }

    public void setMemberId(long memberId) {
        this.memberId = memberId;
    }

    public void setMemberNickname(String memberNickname) {
        this.memberNickname = memberNickname;
    }

    public void setAction(ForumActionEnum action) {
        this.action = action;
    }

    public void setTopicId(long topicId) {
        this.topicId = topicId;
    }

    public void setPostsId(long postsId) {
        this.postsId = postsId;
    }

    public void setRodeMember(long rodeMember) {
        this.rodeMember = rodeMember;
    }

    public void setIpAddr(String ipAddr) {
        this.ipAddr = ipAddr;
    }

    public void setToken(String token) {
        this.token = token;
    }
/*
    public String getTopicTitle() {
        return topicTitle;
    }

    public void setTopicTitle(String topicTitle) {
        this.topicTitle = topicTitle;
    }*/

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public LocalDateTime getDateTime() {
        return dateTime;
    }

    public void setDateTime(LocalDateTime dateTime) {
        this.dateTime = dateTime;
    }
    @Override
    public String getPayload() {
        return new Gson().toJson(this);
    }

    @Override
    public String getBindingNames() {
        return "postsAction";
    }
}
